import Dialog from "../../Game/dialog/Dialog";
import Scene from "../../Scene";
import { DirectionCode, SceneState, TButton, TLayout } from "../../SceneControl";

const { ccclass, property } = cc._decorator;

@ccclass
export default class MineDialogScene extends Scene {

    protected onEnable(): void {
        super.onEnable();
        this.initScene();
    }

    public initScene() {
        let layout = new TLayout();
        let btn = new TButton(this.node);
        let btns = [[btn]];
        btn.addKeyDownEvent(para => para.DirectionCode == DirectionCode.ENTER && this.getComponent(Dialog).closeDialog());
        layout.buttonList = btns;

        this.tscene.sceneState = SceneState.hideFinger;
        this.tscene.addLayout(layout);
        this.tscene.onBack = () => {
            this.getComponent(Dialog).closeDialog();
        }
        this.tscene.joinController();
    }

}
